#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/UIView.h>
#import <UIKit/UIControl.h>
#import <UIKit/UITextView.h>
#import <UIKit/UITransformAnimation.h>
#import <UIKit/UIAnimator.h>
#import <UIKit/UIPushButton.h>
#import "WebCore/WebFontCache.h"

#import "FDScoreCardView.h"
#import "FDDefaultsController.h"
#import "FDDiePushButton.h"

@interface NSObject (GameViewDelegateMethods)

- (void)changeStateTo:(int)state;
- (void)updateRollButtonWithLast:(BOOL)withLast;

@end

@interface FDGameView : UIView
{
	id	delegate;
	
	FDDefaultsController 		*defaults;
	
	struct CGRect				_contentRect;
	struct CGRect				_offScreenRect;
	struct CGRect				_onScreenRect;
	
	UITransformAnimation	*translate;
	UIAnimator				*animator;
	
	UITextLabel			*scoreLabel;
	UITextLabel			*turnsLabel;
	
	FDScoreCardView		*scoreCardView;
	
	NSMutableArray		*diceButtons;
	
	// For Game Persistence
	NSMutableArray		*pDiceValues;
	
	int					rollCount;
	int					lastRoll;
	int					turnCount;
	int					diceTotal;
	
	int					dieValues[6];
	int					lastScore;
	
	BOOL				wildcard;
	BOOL				yahtzeeScratched;
	BOOL				fromLastPosition;	
	BOOL 				hasTwo;
	BOOL 				hasThree;
	BOOL 				hasFour;
	BOOL 				hasFive;
	BOOL				hasSmStraight;
	BOOL				hasLgStraight;
	BOOL				shouldClearHolds;
	
	
}

#pragma mark Show and Hide Methods
- (void)show;
- (void)hide;

#pragma mark Game Methods
-(void)newGame;

#pragma mark Dice Methods
- (void)draw5Dice;
- (FDDiePushButton *)diceButtonWithPosition:(int)pos;
- (struct CGRect)rectForDiePosition:(int)pos;
- (void)dieSelected:(FDDiePushButton *)button;
- (void)clearDieValues;

#pragma mark Counters
- (int)rollCount;
- (void)setRollCount:(int)newRollCount;
- (void)resetRollCount;
- (int)turnCount;
- (void)setTurnCount:(int)newTurnCount;
- (void)resetTurnCount;
- (int)lastRoll;
- (void)setLastRoll:(int)newLastRoll;
- (void)resetLastRoll;
- (int)diceTotal;
- (void)setDiceTotal:(int)newDiceTotal;

#pragma mark Accessors
- (BOOL)shouldClearHolds;
- (void)setShouldClearHolds:(BOOL)newShouldClearHolds;

#pragma mark Delegate
- (id)delegate;
- (void)setDelegate:(id)newDelegate;

@end
